export default {
  // Global page headers: https://go.nuxtjs.dev/config-head
  server: {
    host: '0.0.0.0', // 允许外部访问
    port: 3000 // 默认端口，可自定义
  },
  head: {
    title: 'xzcx_nuxt_pc',
    htmlAttrs: {
      lang: 'zh'
    },
    meta: [{
        charset: 'utf-8'
      },
      {
        name: 'viewport',
        content: 'width=device-width, initial-scale=1'
      },
      {
        hid: 'description',
        name: 'description',
        content: ''
      },
      {
        name: 'format-detection',
        content: 'telephone=no'
      },
      {
        name: 'referrer',
        content: 'no-referrer'
      },
      {
        name: 'sogou_site_verification',
        content: 'qYVpRONMuz'
      },
      {
        'http-equiv': '"Content-Type',
        content: 'text/html;charset=utf-8'
      },
      {
        name: '360-site-verification',
        content: '582496a4d0181d2b729469d14a723f20'
      },
      {
        name: 'applicable-device',
        content: 'pc'
      },
    ],
    link: [{
      rel: 'icon',
      type: 'image/x-icon',
      href: 'https://www.xzcs2022.com/favicon.ico'
    }, {
      rel: 'canonical',
      href: 'https://www.xzcs2022.com'
    }, {
      rel: 'alternate',
      media: "only screen and (max-width: 640px)",
      href: 'https://m.xzcs2022.com'
    }]
  },

  router: {
    middleware: ['checkHashRedirect'] // 注册中间件  
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [
    'element-ui/lib/theme-chalk/index.css'
  ],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
    '@/plugins/element-ui',
    '@/plugins/moment',
  ],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  xtractCSS: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [],

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    transpile: [/^element-ui/],
    extractCSS: true,
    optimization: {
      splitChunks: {
        cacheGroups: {
          styles: {
            name: 'styles',
            test: /\.(css|vue)$/,
            chunks: 'all',
            enforce: true
          }
        }
      }
    },
    loaders: {
      imgUrl: {
        limit: 0
      }, // 小图片转base64
    }
  }
}
